Skip to content

feat(payments): implement Stripe integration for real payments and we…#223

Merged
RUKAYAT-CODER merged 6 commits intorinafcode:mainfrom
Cedarich:feat/stripe-payment-integration
Mar 26, 2026
Merged

feat(payments): implement Stripe integration for real payments and we…#223
RUKAYAT-CODER merged 6 commits intorinafcode:mainfrom
Cedarich:feat/stripe-payment-integration

Conversation

@Cedarich
Copy link
Copy Markdown
Contributor

@Cedarich Cedarich commented Mar 25, 2026

Closes #218


Description

This Pull Request overhauls the PaymentsModule by replacing the placeholder mock provider with a fully operational real-world Stripe API integration for teachLink_backend.

The backend can now handle processing live payment intents, correctly tracking/processing refunds, and fully verifying incoming asynchronous payment webhook events securely.

Specifications

  • Added environment schema validations for STRIPE_SECRET_KEY & STRIPE_WEBHOOK_SECRET.
  • Enabled rawBody: true globally via NestFactory to allow accurate Stripe webhook cryptographic signature verification.
  • Implemented actual Stripe SDK pm/pi creations and refund dispatching within StripeService.
  • Replaced the hard-coded mocked getProvider method inside PaymentsService with a dynamic ProviderFactoryService injection.
  • Refactored Webhook handling to capture raw buffer streams securely through NestJS and process payment_intent.succeeded/failed natively.

Close #[issue-number]

Acceptance Criteria Achieved

  • Real payments processed through Stripe
  • Refunds processed correctly
  • Webhooks securely handle payment events and signatures
  • Payment failures handled gracefully
  • Transaction history accurately kept

Note: Please make sure to add the new Stripe secret keys to your environment configurations (e.g. .env) locally and upstream before testing 🚀!

close issue #218
close issue #219

@RUKAYAT-CODER RUKAYAT-CODER merged commit c56a24b into rinafcode:main Mar 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Real Payment Provider

3 participants